package org.EasyDevelop.Builder;

import org.EasyDevelop.Bean.Constants;
import org.EasyDevelop.Utils.DateUtils;

import java.io.BufferedWriter;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class CommentBuilder {
    public static void createClassComment(BufferedWriter bw,String classComment) throws Exception {
        /**
         * @Description
         * @Date 2024/6/25
         */
        bw.write("/**");
        bw.newLine();
        bw.write(" * @Description " + classComment);
        bw.newLine();
        bw.write(" * @Author " + Constants.AUTHOR);
        bw.newLine();
        bw.write(" * @Date " + DateUtils.format(new Date(),DateUtils.YYYY_MM_DD_2));
        bw.newLine();
        bw.write(" */");
        bw.newLine();
    };
    public static void createFieldComment(BufferedWriter bw,String fieldComment) throws IOException {
        bw.write("\t/**");
        bw.newLine();
        bw.write("\t * " + fieldComment);
        bw.newLine();
        bw.write("\t */");
        bw.newLine();
    }
    public static void createMethodComment(BufferedWriter bw,String methodComment) throws IOException {
        bw.write("\t/**");
        bw.newLine();
        bw.write("\t * " + methodComment);
        bw.newLine();
        bw.write("\t */");
        bw.newLine();
    }
    public static void createXMLComment(BufferedWriter bw,String XMLComment,String t) throws IOException {
        bw.write(t + "<!--");
        bw.write(XMLComment);
        bw.write(" -->");
        bw.newLine();
    }

}
